package ltq.telphoneAgeAverage;

import org.apache.storm.Config;
import org.apache.storm.LocalCluster;
import org.apache.storm.StormSubmitter;
import org.apache.storm.topology.TopologyBuilder;

public class TAATopology {
    public static String SPOUTID_TAA ="TAASpout";
    public static String BOLTID_TAA ="TAABOLT";
    public static String SPOUTID_HB ="HBSpout";
    public static String BOLTID_HB ="HBBOLT";
    public static void main(String[] args) throws Exception {
        String topologyName=args[0];
        String filePath="src/main/resources/ltqdata/electronicsWashed.csv";
        TopologyBuilder builder=new TopologyBuilder();
        builder.setSpout(SPOUTID_TAA,new TAASpout(),1).setNumTasks(1);
        builder.setBolt(BOLTID_TAA,new TAABolt(),1)
                .shuffleGrouping(SPOUTID_TAA)
                .setNumTasks(1);

        builder.setSpout(SPOUTID_HB,new HotBrandSpout(),1).setNumTasks(1);
        builder.setBolt(BOLTID_HB,new HotBrandBolt(),1)
                .shuffleGrouping(SPOUTID_HB)
                .setNumTasks(1);

        Config config = new Config();
//        LocalCluster local = new LocalCluster();
//        local.submitTopology(topologyName, config, builder.createTopology());
        StormSubmitter.submitTopology(topologyName,config,builder.createTopology());
    }
}
